#!/bin/bash -e

function info() {
echo Usage: `basename $0` 'in.bed'
exit 65
}

while getopts  ":s:p:" opts
do
        case  $opts  in
        s) sample_name=$OPTARG;;
		p) out_prefix=$OPTARG;;
		\?) echo info;;
        esac
done
shift $(($OPTIND - 1))


if [ $# -lt 2 ]; then info; fi


. /mnt/ilustre/app/medical/tools/.var

java $tmp -jar ${picard_path}/ExtractSequences.jar \
O=$out_prefix.extract_ref.bam \
SORT_ORDER=coordinate \
CREATE_INDEX=true \
LINE_LENGTH=150 \
INTERVAL_LIST=$1 \
REFERENCE_SEQUENCE=$ref_genome


. $cmd_done